package com.ruoyi.web.controller.shop.imgs.service.impl;

import javax.annotation.Resource;

import com.ruoyi.web.controller.shop.imgs.domain.ShopImages;
import com.ruoyi.web.controller.shop.imgs.mapper.ShopImagesMapper;
import com.ruoyi.web.controller.shop.imgs.service.IShopImagesService;
import com.ruoyi.web.utils.uniquekey.IdGererateFactory;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 店铺图片Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-10-17
 */
@Service
public class ShopImagesServiceImpl implements IShopImagesService
{
    @Resource
    private IdGererateFactory idGererateFactory;

    @Autowired
    private ShopImagesMapper shopImagesMapper;

    /**
     * 查询店铺图片
     * 
     * @param id 店铺图片ID
     * @return 店铺图片
     */
    @Override
    public ShopImages selectShopImagesById(String id)
    {
        return shopImagesMapper.selectShopImagesById(id);
    }

    /**
     * 查询店铺图片列表
     * 
     * @param shopImages 店铺图片
     * @return 店铺图片
     */
    @Override
    public List<ShopImages> selectShopImagesList(ShopImages shopImages)
    {
        return shopImagesMapper.selectShopImagesList(shopImages);
    }

    /**
     * 新增店铺图片
     * 
     * @param shopImages 店铺图片
     * @return 结果
     */
    @Override
    public int insertShopImages(ShopImages shopImages)
    {
        shopImages.setId(this.idGererateFactory.nextStringId());
        return shopImagesMapper.insertShopImages(shopImages);
    }

    /**
     * 修改店铺图片
     * 
     * @param shopImages 店铺图片
     * @return 结果
     */
    @Override
    public int updateShopImages(ShopImages shopImages)
    {
        return shopImagesMapper.updateShopImages(shopImages);
    }

    /**
     * 批量删除店铺图片
     * 
     * @param ids 需要删除的店铺图片ID
     * @return 结果
     */
    @Override
    public int deleteShopImagesByIds(String[] ids)
    {
        return shopImagesMapper.deleteShopImagesByIds(ids);
    }

    /**
     * 删除店铺图片信息
     * 
     * @param id 店铺图片ID
     * @return 结果
     */
    @Override
    public int deleteShopImagesById(String id)
    {
        return shopImagesMapper.deleteShopImagesById(id);
    }

    @Override
    public int deleteByShopId(String id) {
        return this.shopImagesMapper.deleteByShopId(id);
    }
}
